package com.googlecode.continuity.core.server.mvc.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import com.googlecode.continuity.core.server.mvc.ContinuityModel;

/**
 * AdminPanelController serves a page that is enriched with GWT, enabling a user with administration rights to modify
 * the system configuration.
 *
 * todo: replace with generic controller?
 *
 * @author Peter Schmitt <aragos@aragos.de>
 */
public class AdminPanelController implements Controller {
  /**
   * Logger for this class and subclasses
   */
  protected final Log logger = LogFactory.getLog(getClass());

  public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    //  TODO: no literals as titel! use templates/messages/i18n instead
    ContinuityModel model = new ContinuityModel();

    logger.info("Returning admin panel view.");
    return new ModelAndView("adminpanel", model);
  }

}
